Skip to content

Conversation

@mikaelm12
Copy link
Contributor

Adding some tests to check that we properly parse some different unusual HandshakeRequest messages. This came out of the meeting earlier today.

@Pilchie Pilchie added the area-signalr Includes: SignalR clients and servers label Aug 26, 2019
[InlineData("{\"protocol\":\"\",\"version\":10,\"unknown\":null}\u001e", "", 10)]
[InlineData("{\"protocol\":\"firstProtocol\",\"protocol\":\"secondProtocol\",\"version\":1}\u001e", "secondProtocol", 1)]
[InlineData("{\"protocol\":\"firstProtocol\",\"protocol\":\"secondProtocol\",\"version\":1,\"version\":75}\u001e", "secondProtocol", 75)]
[InlineData("{\"protocol\":\"dummy\",\"version\":1,\"ignoredField\":99}\u001e", "dummy", 1)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there's multiple json objects prior to the \u001e delimiter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some tests for escaped property names too

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if there's multiple json objects prior to the \u001e delimiter.

For the handshake, the parsing logic returns as soon as the end of the json object is found. So the paylod
"{\"protocol\":\"json\",\"version\":1}{\"protocol\":\"wrong\",\"version\":99}\u001e" would result in a Handshake request message with json and version 1.

@mikaelm12
Copy link
Contributor Author

@aspnet-hello
Copy link

This comment was made automatically. If there is a problem contact [email protected].

I've triaged the above build.

@mikaelm12 mikaelm12 merged commit af0a204 into master Aug 27, 2019
@mikaelm12 mikaelm12 deleted the mikaelm12/MoreHandshakeParsingTests branch August 27, 2019 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-signalr Includes: SignalR clients and servers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants